import ajax from "./index";

// 登录
// /api/login

export const Login = (data) =>{
    return ajax({
        url:'/sys/login',
        method:'post',
        data
    })
}
// 员工  /sys/user

export const User = params =>{
    return ajax({
        url:'/sys/user',
        method:'get',
        params
    })
}
// 获取-员工-基本信息  /sys/user/{id}
export const UserMsg = id =>{
    return ajax({
        url:`sys/user/${id}`,
        method:'get',
        params:id
    })
}
// 获取-员工-个人信息  /employees/{id}/personalInfo
export const PersonalInfo = id =>{
    return ajax({
        url:`/employees/${id}/personalInfo`,
        method:'get',
        params:id
    })
}
// 获取-员工-岗位信息  /employees/{id}/jobs
export const jobs = id =>{
    return ajax({
        url:`/employees/${id}/jobs`,
        method:'get',
        params:id
    })
}
// 分配-员工-角色  /sys/user/assignRoles

export const assignRoles = data =>{
    return ajax({
        url:'/sys/user/assignRoles',
        method:'put',
        data
    })
}
// 获取-角色列表  /sys/role
export const role = params =>{
    return ajax({
        url:'/sys/role',
        method:'get',
        params
    })
}
// 获取-角色详情 /sys/role/{id} /sys/role/{id}
export const roleDetail = id =>{
    return ajax({
        url:`/sys/role/${id}`,
        method:'get',
        params:id
    })
}
// /sys/user/{id} /sys/user/{id}
export const DelUser = id =>{
    return ajax({
        url:`/sys/role/${id}`,
        method:'DELETE',
        params:id
    })
}
//  获取-用户基本资料 /sys/profile
export const profile = data =>{
    return ajax({
        url:'/sys/profile',
        method:'POST',
        data
    })
}
// 新增-员工  /sys/user
export const AddUser = data =>{
    return ajax({
        url:'/sys/user',
        method:'POST',
        data
    })
}
// /sys/user/{id}  修改-员工-基本信息
export const EditUser = (id,data) =>{
    return ajax({
        url:`/sys/user/${id}`,
        method:'put',
        data
    })
}
// /user/process/instance/{page}/{size}  查询申请列表
export const process = (page,size,data) =>{
    return ajax({
        url:`/user/process/instance/${page}/${size}`,
        method:'put',
        data
    })
}
// 获取-部门列表  /company/department

export const department = params =>{
    return ajax({
        url:'/company/department',
        method:'get',
        params
    })
}

// 获取-权限点列表  /sys/permission
export const permission = params =>{
    return ajax({
        url:'/sys/permission',
        method:'get',
        params
    })
}

// 新增部门  /company/department
export const Adddepartment = data =>{
    return ajax({
        url:'/company/department',
        method:'post',
        data
    })
}
// 查询所有的流程定义   /user/process/definition

export const definition = params =>{
    return ajax({
        url:'/user/process/definition',
        method:'get',
        params
    })
}

// 发起流程申请   /user/process/startProcess

export const startProcess = data =>{
    return ajax({
        url:'/user/process/startProcess',
        method:'post',
        data
    })
}
// 获取所有角色列表 /sys/role
export const sysrole = params =>{
    return ajax({
        url:'/sys/role',
        method:'get',
        params
    })
}
// 新增-角色  /sys/role
export const addRole = data =>{
    return ajax({
        url:'/sys/role',
        method:'post',
        data
    })
}

// 删除-角色 /sys/role/{id}  DELETE


export const DelRole = id=>{
    return ajax({
        url:`/sys/role/${id}`,
        method:'DELETE',
        
    })
}

// 修改-角色详情  /sys/role/{id}  PUT

export const EditRole = (id,data)=>{
    return ajax({
        url:`/sys/role/${id}`,
        method:'PUT',
        data:data
    })
}


// 删除-权限点  /sys/permission/{id}
export const Dellimit = (id)=>{
    return ajax({
        url:`/sys/permission/${id}`,
        method:'DELETE',
        
    })
}
// 新增-权限点  /sys/permission
export const Addlimit = (data)=>{
    return ajax({
        url:'/sys/permission',
        method:'POST',
        data
        
    })
}
<<<<<<< HEAD
// 修改-权限点详情  /sys/permission/{id}
export const Editlimit = (data)=>{
    return ajax({
        url:`/sys/permission/${id}`,
        method:'PUT',
        data
        
    })
}
//  分配权限-角色 /sys/role/assignPrem
export const assignPrem = (data)=>{
    return ajax({
        url:'/sys/role/assignPrem',
        method:'PUT',
        data
        
    })
}

// 
=======

// 删除-部门详情  /company/department/{id}
export const Deldepartment = (id)=>{
    return ajax({
        url:`/company/department/${id}`,
        method:'DELETE',
        
        
    })
}
>>>>>>> limit
